<template>
	<el-card shadow="hover" header="工作便签" style="background-color: #4397fa;color:white">
		<div style="height: 210px;width: 100%">
			<el-input type="textarea" v-model="form.content" :show-word-limit="true" :maxlength="500" rows="9" @change="saveBookMark">
			</el-input>
		</div>
	</el-card>
</template>

<script>
export default {
	components: {
	},
	data() {
		return {
			form:{
				content:''
			}
		}
	},
	created() {
	},
	beforeUnmount() {
	},
	mounted() {
		this.getMyBookMark();
	},
	methods: {
		async saveBookMark(){
			let res = await this.$API.info.bookMark.setBookMark.post(this.form);
			if (res.code === 200) {
			} else {
				this.$alert(res.message, "提示", {type: 'error'})
			}

		},
		async getMyBookMark()
		{
			let res = await this.$API.info.bookMark.getMyBookMark.get();
			if (res.code === 200) {
				if(res.data!=null)
				{
					this.form = res.data;
				}
			} else {
				this.$alert(res.message, "提示", {type: 'error'})
			}
		}
	}
}
</script>
<style scoped>
:deep(.el-card__header){
	background: rgba(64, 158, 255, 0.6);
	color: white;
	padding: 10px 20px 10px 20px;
}
:deep(.el-textarea__inner){
	box-shadow: unset;
	background-color: #4397fa;
	color:white;
}
:deep(.el-input__count){
	background-color: #4397fa;
	color:white;
}
</style>
